#include "traceur.h"
#include <wx/file.h>

wxString Traceur::m_sFilename = "trace.log";
int      Traceur::m_iType     = ODS;

/**
 * Traceur::Printf
 */
void Traceur::Printf(const char* sFormat, ...)
{
    va_list args;
    va_start(args, sFormat);

    char buffer[256];
    vsprintf(buffer, sFormat, args);

    va_end(args);

#ifdef __WXMSW__
    if (m_iType & ODS)
    {
        OutputDebugString(buffer);
    }
#endif // __WXMSW__

    if (m_iType & FILE)
    {
        wxFile file;
        if (file.Open(m_sFilename, wxFile::write_append))
        {
            file.Write(buffer);
            file.Close();
        }
    }

}
